﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HSupportingMaterials.aspx.cs"
    Inherits="AB.ServiceDirectory.Design.Org.HSupportingMaterials" MasterPageFile="~/Site.Master" %>

<%@ Import Namespace="AB.ServiceDirectory.Commons" %>
<asp:Content ID="head" runat="server" ContentPlaceHolderID="head">
</asp:Content>
<asp:Content ID="ContentTitle" ContentPlaceHolderID="ContentTitle" runat="server">
    <h2>
        Organisation Details
    </h2>
</asp:Content>
<asp:Content ID="Content" ContentPlaceHolderID="Content" runat="server">
    <asp:UpdatePanel runat="server">
        <ContentTemplate>
            <div class="grid740 simplebox">
                <asp:Panel ID="CurrentListSupportingMaterials" ClientIDMode="Static" runat="server">
                    <div class="titleh">
                        <h3 class="sorting_range">
                            <span>Current List of Supporting Materials </span><span class="right">
                                <asp:HyperLink ID="HyperLinkCreate" runat="server" CssClass="hg-blue" NavigateUrl="~/Organisation/HAddSupportingMaterial.aspx">Create</asp:HyperLink>
                                <asp:CheckBox ID="CheckBoxInactive" runat="server" Text="Include In-active" AutoPostBack="True"
                                    OnCheckedChanged="CheckBoxInactive_CheckedChanged" />
                            </span>
                        </h3>
                    </div>
                    <asp:GridView ID="GridViewSupportingMaterials" CssClass="tablesorter" runat="server"
                        AutoGenerateColumns="False" AllowPaging="True" PageSize="15" AllowSorting="True"
                        DataSourceID="ObjectDataSourceSupportingMaterial">
                        <Columns>
                            <asp:TemplateField HeaderText="URL" SortExpression="URL">
                                <ItemTemplate>
                                    <%--<asp:HyperLink ID="HyperLink1" runat="server" 
                                        NavigateUrl='<%# Eval("SupportingMaterialId", "~/Organisation/HEditSupportingMaterial.aspx?id={0}") %>' 
                                        Text='<%# Eval("Url") %>'></asp:HyperLink>--%>
                                    <asp:LinkButton ID="LinkButtonUrl" runat="server" CommandName="EditAttribute" CommandArgument='<%#Eval("SupportingMaterialId") %>'
                                        OnCommand="LinkButtonUrl_Command"><%# Eval("Url") %></asp:LinkButton>
                                </ItemTemplate>
                                <HeaderStyle CssClass="header" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Description" SortExpression="Description">
                                <ItemTemplate>
                                    <%#StringTools.Substring(Eval("Description"), 0, 45, true)%>
                                </ItemTemplate>
                                <HeaderStyle CssClass="header" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type">
                                <HeaderStyle CssClass="header" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Added By" SortExpression="AddedBy">
                                <ItemTemplate>
                                    <%#Eval("User.Account") %>
                                </ItemTemplate>
                                <HeaderStyle CssClass="header" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Added Date" SortExpression="AddedDate">
                                <ItemTemplate>
                                    <%#string.Format("{0:dd/MM/yyyy}",Eval("AddedDate"))%>
                                </ItemTemplate>
                                <HeaderStyle CssClass="header" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Is Active" SortExpression="IsActive">
                                <ItemTemplate>
                                    <%#(bool) Eval("IsActive")?"Yes":"No" %>
                                </ItemTemplate>
                                <HeaderStyle CssClass="header" />
                            </asp:TemplateField>
                        </Columns>
                        <PagerStyle CssClass="pagination_table" />
                    </asp:GridView>
                    <asp:ObjectDataSource ID="ObjectDataSourceSupportingMaterial" runat="server" SelectMethod="GetSupportingMaterial"
                        TypeName="AB.ServiceDirectory.BO.HSupportingMaterialBO" OnSelecting="ObjectDataSourceSupportingMaterialSelecting"
                        EnablePaging="true" SelectCountMethod="GetSupportingMaterialCount" StartRowIndexParameterName="startRowIndex"
                        MaximumRowsParameterName="maxRows" SortParameterName="sortType">
                        <SelectParameters>
                            <asp:Parameter Name="filter" Type="Object" ConvertEmptyStringToNull="false" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                </asp:Panel>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
